package com.ftg.learn.framework.mybatis.chapter03.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 布衣
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {

    Integer status;

    String msg;

    Object data;

    public static R ok() {
        return new R(200,"操作已成功!!!",null);
    }

    public static R ok(String msg) {
        return new R(200,msg,null);
    }

    public static R ok(String msg,Object data) {
        return new R(200,msg,data);
    }

    public static R error() {
        return new R(500,"操作已失败!!!",null);
    }

    public static R error(String msg) {
        return new R(500,msg,null);
    }

}
